

<%@ page import="org.icress.fusion.admin.Profile" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="main" />
    <g:set var="entityName" value="${message(code: 'admin.profile.label', default: 'Profile')}" />
    <title><g:message code="default.edit.label" args="[entityName]" /></title>
</head>
<body>
    <div class="nav">
        <shiro:hasPermission permission="profile:list">
        <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
        </shiro:hasPermission>
        <shiro:hasPermission permission="profile:create">
        <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </shiro:hasPermission>
    </div>
    <div class="body">
        <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
        <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
        </g:if>
        <g:hasErrors bean="${profileInstance}">
        <div class="errors">
            <g:renderErrors bean="${profileInstance}" as="list" />
        </div>
        </g:hasErrors>
        <g:form method="post" >
            <g:hiddenField name="id" value="${profileInstance?.id}" />
            <g:hiddenField name="version" value="${profileInstance?.version}" />
            <div class="dialog">
                <g:render template="/admin/profile/edit" model="[profileInstance:profileInstance]" />
            </div>
            <div class="buttons">
            	<shiro:hasPermission permission="profile:update">
                <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update', default: 'Update')}" /></span>
                </shiro:hasPermission>
                <shiro:hasPermission permission="profile:delete">
                <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </shiro:hasPermission>
            </div>
        </g:form>
    </div>
</body>
</html>
